home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tas412.zip / DM.TAS < prev    next >
Text File  |  1991-08-17  |  1KB  |  43 lines

  1. #output_file 'dm.lst'
  2. #max_quotes 55
  3. { WILDER.TAS
  4.    Wilder's Directional Movement Trading Example
  5.    This script will indicate
  6.       a BUY signal
  7.          if the +DI(14) crosses above -DI(14) and ADXR > 25
  8.       a SELL signal
  9.          if the -DI(14) crosses above +DI(14) and ADXR > 25
  10. }
  11. pdi_array : array;   { declare the +DI (Positive Directional Movement array}
  12. mdi_array : array;   { declare the -DI (Negative Directional Movement array}
  13.  
  14. pdi_array := pdi(14);   { calculate +DI}
  15. mdi_array := mdi(14);   { calculate -DI}
  16. adxr_14 := adxr(14);
  17. adx_14  = adx(14);
  18. dx_14   = dx(14);
  19. if first_ticker then 
  20. begin
  21.     writeln('TICKER     NAME            ADXR   DX  ADX  +DI  -DI     ACTION');
  22. end;
  23.  
  24. write(ticker,'  ',fullname,
  25.     int(adxr_14),
  26.     int(dx_14),
  27.     int(adx_14),
  28.     int(pdi_array[0]),
  29.     int(mdi_array[0]));
  30. action = '';
  31.  
  32. if (adxr_14 > 25)   then        { AVG DX Rate of Change > 25 }
  33. begin
  34.  
  35.    if (over(pdi_array,mdi_array) = 0) then
  36.       action = '** BUY SIGNAL';
  37.    else
  38.    if (over(mdi_array,pdi_array) = 0) then
  39.       action = '** SELL SIGNAL';
  40. end;
  41. writeln(action);
  42.  
  43.